/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package network.packets;

import datamodel.Order4;
import utils.Utils;

/**
 *
 * @author Kvest
 */
public class OrderResponce4 extends OrderResponce3 {
    public OrderResponce4(int id) {
        super(id);
    }
    
    public OrderResponce4(byte[] data) {
        super(ORDER_RESPONCE4);
        order = new Order4(-1);

        parse(data);
    }
    
    public void createOrder() {
        order = new Order4(-1);
    }
    
    public int parse(byte[] data, int offset) {
        byte[] buffer4 = new byte[4];
        
        //sourceWhence
        System.arraycopy(data, offset, buffer4, 0, buffer4.length);
        offset += buffer4.length + Utils.byteToInt(buffer4);
        
        //orderCostForDriver;
        offset += 16;
                
        //canFirstForAnyParking;
        offset++;
                
        //distanceToPointOfDelivery;
        offset += 16;
                
        //concessional;
        offset++;
                
        buffer4 = null;
        
        return super.parse(data, offset);
    }
}
